package com.bw.kf.all2211a.login

import android.os.Bundle
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.isVisible
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.bw.kf.all2211a.R
import com.bw.kf.all2211a.databinding.ActivityWebBinding
import com.bw.kf.mvvm.base.BaseViewActivity
@Route(path = "/app/login/WebActivity")
class WebActivity : BaseViewActivity<ActivityWebBinding>() {
      @Autowired
      @JvmField
      var url=""
    override fun iniView() {
        ARouter.getInstance().inject(this)
        val url = intent.extras?.getString("url")
        if (url != null) {
            binding.web.loadUrl(url)
            binding.web.webViewClient= WebViewClient()
           val webChromeClient=object : WebChromeClient(){
                override fun onProgressChanged(view: WebView?, newProgress: Int) {
                    super.onProgressChanged(view, newProgress)
                    if(newProgress==100){
                        binding.pro.isVisible=false
                    }else{
                        binding.pro.isVisible=true
                    }
                }
            }
            binding.web.webChromeClient=webChromeClient
        }
    }
    override fun iniData(){}

    override fun Layoutid()=R.layout.activity_web
}